﻿namespace EasyGo.Utils
{
    using System.Web.Mvc;

    using Newtonsoft.Json;

    public static class JsonExtensions
    {
        public static ActionResult ToJsonResult(this object obj)
        {
            var result = new ContentResult();
            result.Content = JsonConvert.SerializeObject(obj);
            result.ContentType = "application/json";
            return result;
        }
    }
}